package csu.jpetstore.jpetstore.result;

public class ResultFactory {
    public static Result getSuccess(String msg, Object data) {
        Result result = new Result();
        result.setCode(200);
        result.setData(data);
        result.setMessage(msg);
        return result;
    }

    public static Result getFail(String msg, Object data) {
        Result result = new Result();
        result.setCode(400);
        result.setData(data);
        result.setMessage(msg);
        return result;
    }

    public static Result getOne(int code, String msg, Object data) {
        Result result = new Result();
        result.setCode(code);
        result.setData(data);
        result.setMessage(msg);
        return result;
    }
}
